package com.ruoyi.project.search.viewOutJobHistory.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.search.viewOutJobHistory.mapper.ViewOutJobHistoryMapper;
import com.ruoyi.project.search.viewOutJobHistory.domain.ViewOutJobHistory;
import com.ruoyi.project.search.viewOutJobHistory.service.IViewOutJobHistoryService;
import com.ruoyi.common.core.text.Convert;

/**
 * 出库流水Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-08-30
 */
@Service
public class ViewOutJobHistoryServiceImpl implements IViewOutJobHistoryService 
{
    @Autowired
    private ViewOutJobHistoryMapper viewOutJobHistoryMapper;

    /**
     * 查询出库流水
     * 
     * @param jobDetailId 出库流水主键
     * @return 出库流水
     */
    @Override
    public ViewOutJobHistory selectViewOutJobHistoryByJobDetailId(String jobDetailId)
    {
        return viewOutJobHistoryMapper.selectViewOutJobHistoryByJobDetailId(jobDetailId);
    }

    /**
     * 查询出库流水列表
     * 
     * @param viewOutJobHistory 出库流水
     * @return 出库流水
     */
    @Override
    public List<ViewOutJobHistory> selectViewOutJobHistoryList(ViewOutJobHistory viewOutJobHistory)
    {
        return viewOutJobHistoryMapper.selectViewOutJobHistoryList(viewOutJobHistory);
    }

    /**
     * 新增出库流水
     * 
     * @param viewOutJobHistory 出库流水
     * @return 结果
     */
    @Override
    public int insertViewOutJobHistory(ViewOutJobHistory viewOutJobHistory)
    {
        viewOutJobHistory.setCreateTime(DateUtils.getNowDate());
        return viewOutJobHistoryMapper.insertViewOutJobHistory(viewOutJobHistory);
    }

    /**
     * 修改出库流水
     * 
     * @param viewOutJobHistory 出库流水
     * @return 结果
     */
    @Override
    public int updateViewOutJobHistory(ViewOutJobHistory viewOutJobHistory)
    {
        return viewOutJobHistoryMapper.updateViewOutJobHistory(viewOutJobHistory);
    }

    /**
     * 批量删除出库流水
     * 
     * @param jobDetailIds 需要删除的出库流水主键
     * @return 结果
     */
    @Override
    public int deleteViewOutJobHistoryByJobDetailIds(String jobDetailIds)
    {
        return viewOutJobHistoryMapper.deleteViewOutJobHistoryByJobDetailIds(Convert.toStrArray(jobDetailIds));
    }

    /**
     * 删除出库流水信息
     * 
     * @param jobDetailId 出库流水主键
     * @return 结果
     */
    @Override
    public int deleteViewOutJobHistoryByJobDetailId(String jobDetailId)
    {
        return viewOutJobHistoryMapper.deleteViewOutJobHistoryByJobDetailId(jobDetailId);
    }
}
